package main

import (
	"tools_go/common/ginmiddleware"
	"tools_go/common/logger"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	// 加载全局中间件
	r.Use(ginmiddleware.TranceIdMiddleware())

	pingFunc := func(c *gin.Context) {
		logger.Warn("哈哈哈哈哈哈哈")
		c.JSON(200, gin.H{
			"message": "pong",
		})
		logger.Warn("111111111")
	}
	r.GET("/ping", pingFunc)
	r.Run() // listen and serve on 0.0.0.0:8080
}
